<?php

class Back_Model_Mapper_Tournois extends Jnd_Model_Mapper_Abstract
{

    protected $_dict = array(
            "id" => "id_tournois",
            "nom" => "nom",
            "date" => "date",
            "heure" => "heure",
            "lieu" => "lieu",
            "ouvert" => "ouvert",
    );

    protected $_dictDate = array(
            "date" => "date",
    );

    public function chercherParNom($nom) {
        $table = $this->_getTable();
        $select = new Zend_Db_Table_Select($table);
        $select->where($this->getDict("nom") . " =?", $nom);
        $stmt = $select->query();
        $result = $stmt->fetch();
        if ($result === false) {
            $result = array();
        } else {
            $result = $this->unmap($result);
        }
        
        return $result;
    }

}